Skip to content

Conversation

@krlmlr
Copy link
Contributor

@krlmlr krlmlr commented Oct 26, 2025

These are the essential difference between the main and next branches. This is not intended to be merged, just as a review tool.

Do any of these differences look suspicious? Let's discuss here and resolve.

Generated with:

git diff next -- ':(exclude)man' ':(exclude)src/vendor' ':(exclude)patch' ':(exclude)src/Makevars.*' ':(exclude)src/rinterface.*' ':(exclude)src/cpp11.cpp' ':(exclude)NEWS.md' ':(exclude)R/aaa-auto.R' ':(exclude)cran-comments.md' ':(exclude)tools/stimulus/' ':(exclude)src/sources-igraph.mk' | patch -p1 -R

@szhorvat @schochastics: We do benefit from taking a closer look here, but we will also catch errors later. I'll review too.

Copy link
Contributor Author

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid to me, by and large. Appreciate a second pair of eyes.

if (lifecycle::is_present(directed)) {
if (directed) {
lifecycle::deprecate_soft(
"2.2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and everywhere:

Suggested change
"2.2.0",
"3.0.0",

Comment on lines +405 to +406
#' centr_degree(g, normalized = FALSE)$centralization /
#' centr_degree_tmax(g, loops = "twice")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember I wasn't sure about this. For centr_degree(), the default is "twice" IIRC. Is then the same loops value needed in the denominator?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is correct.

)
}
0L
# Catch all errors
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also go into main .

if (!is(with, "igraph_rewiring_method")) {
cli::cli_abort(
"{.arg with} must be an igraph rewiring method,
"{.arg with} must be an igraph rewiring method,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in main.

Comment on lines +74 to +75
#' @param directed Boolean.Whether to consider the directions of edges.
#' The default, `TRUE` means that edge directions will be considered.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#' @param directed Boolean.Whether to consider the directions of edges.
#' The default, `TRUE` means that edge directions will be considered.
#' @param directed Boolean. Whether to consider the directions of edges.
#' The default, `TRUE` means that edge directions will be considered.

#' @rdname degree
#' @export
#' @cdocs igraph_maxdegree
max_degree <- maxdegree_impl
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could ask Copilot, could manually backport to main .

Two more functions that were forgotten: mean_distance() and sample_spanning_tree() .

@krlmlr krlmlr requested a review from Copilot October 26, 2025 14:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR contains essential differences between the main and next branches for review. The changes primarily focus on updating function signatures, parameter names, and implementations to align with underlying igraph C library updates.

Key changes:

  • Standardization of parameter names (e.g., directedmode, loops from boolean to character)
  • Updates to match C library API changes (attribute handling, function signatures)
  • Addition of new function parameters and deprecation of old ones

Reviewed Changes

Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/testthat/test-structural-properties.R Updates test parameters to use new loop handling syntax
tests/testthat/test-simple.R Adds test for is_simple() with directed parameter
tests/testthat/test-interface.R Adds snapshot tests for incident() function
tests/testthat/test-centrality.R Adds warning suppression for eigen_centrality()
tests/testthat/test-aaa-auto.R Removes tests for deprecated functions, updates parameter names
tests/testthat/_snaps/*.md Updates snapshots to match new function behaviors and error messages
src/rinterface_extra.c Major updates to match C library API changes for attributes and functions
R/*.R Updates R function signatures, adds deprecations, parameter renaming

PROTECT(app=R_igraph_strvector_to_SEXP(tmprec->value.as_strvector));
break;
default:
break;
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of a default case that does nothing could lead to app being used uninitialized if an unexpected attribute type is encountered. Consider either initializing app to R_NilValue before the switch, or handling the default case with an error.

Suggested change
break;
igraph_error("Unknown attribute type, internal error", __FILE__, __LINE__,
IGRAPH_EINVAL);
return R_NilValue;

Copilot uses AI. Check for mistakes.
}

igraph_error_t R_igraph_interrupt_handler(void *data) {
igraph_bool_t R_igraph_interrupt_handler(void) {
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type changed from igraph_error_t to igraph_bool_t, and the function signature removed the void *data parameter. Ensure all call sites have been updated accordingly to match this new signature.

Copilot uses AI. Check for mistakes.
Comment on lines +882 to +883
#' `"twice"` (the default) counts each loop edge twice in undirected graphs
#' and once in directed graphs.
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 883 is missing proper punctuation. It should either end with a period or be properly connected to line 882. The current formatting suggests it's a continuation but lacks proper grammatical structure.

Suggested change
#' `"twice"` (the default) counts each loop edge twice in undirected graphs
#' and once in directed graphs.
#' `"twice"` (the default) counts each loop edge twice in undirected graphs and once in directed graphs.

Copilot uses AI. Check for mistakes.
Comment on lines +393 to +394
#' `"twice"` counts each loop edge twice in undirected graphs.
#' and once in directed graphs.
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 394 appears orphaned from the previous line's structure. It should either be joined to line 393 or reformatted as a continuation of the bullet point structure.

Suggested change
#' `"twice"` counts each loop edge twice in undirected graphs.
#' and once in directed graphs.
#' `"twice"` counts each loop edge twice in undirected graphs and once in directed graphs.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants